package com.mars.push.core.factory;

import com.mars.push.core.service.PushService;
import com.mars.push.core.service.impl.*;

/**
 * @author mjy
 * @date 2021-03-05
 */
public class PushFactory {

    /**
     * 获取实例
     *
     * @param device 设备
     * @return PushStrategy
     */
    public static synchronized PushService getInstance(String device) {
        switch (device.toLowerCase()) {
            case "xiaomi":
                return new XiaomiPushServiceImpl();
            case "huawei":
                return new HuaweiPushImpl();
            case "vivo":
                return new VivoPushServiceImpl();
            case "ios":
                return new IosPushImpl();
            case "oppo":
                return new OppoPushServiceImpl();
            default:
        }
        return null;
    }
}
